/* 失分明细表单样式 - 美观圆润版本 */
:root {
  --primary-color: #667eea;
  --primary-light: #a5b4fc;
  --primary-dark: #5a67d8;
  --success-color: #48bb78;
  --warning-color: #ed8936;
  --danger-color: #f56565;
  --info-color: #4299e1;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --border-radius: 16px;
  --border-radius-sm: 12px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式重置 */
.loss-detail-form * {
  box-sizing: border-box;
}

.loss-detail-form {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  padding: 20px 0;
}

/* 卡片容器 */
.loss-detail-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: none;
  overflow: hidden;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.loss-detail-card-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  padding: 1.5rem 2rem;
  border-bottom: none;
  position: relative;
  overflow: hidden;
}

.loss-detail-card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: cover;
}

.loss-detail-card-header h4 {
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loss-detail-card-header .back-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  backdrop-filter: blur(10px);
}

.loss-detail-card-header .back-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-3px);
}

/* 卡片主体 */
.loss-detail-card-body {
  padding: 2.5rem;
}

/* 成绩信息展示区域 */
.exam-info-section {
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border-radius: var(--border-radius-sm);
  padding: 1.5rem;
  border-left: 4px solid var(--primary-color);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.exam-info-section h5 {
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exam-info-section .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.warning-banner {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 1px solid #ffecb3;
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  color: #856404;
  font-weight: 500;
}

/* 表单字段样式 */
.form-section {
  margin-bottom: 2rem;
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.required-star {
  color: var(--danger-color);
  font-weight: bold;
}

/* 表单控件美化 */
.form-control, .form-select {
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-white);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: var(--bg-white);
}

.form-control.is-invalid, .form-select.is-invalid {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1);
}

/* 自定义知识点切换区域 */
.custom-knowledge-toggle {
  background: linear-gradient(135deg, #f0f4ff, #f8f9ff);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
  border: 2px dashed #c3dafe;
  transition: var(--transition);
}

.custom-knowledge-toggle:hover {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, #e6f0ff, #f0f4ff);
}

/* 输入组美化 */
.input-group {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.input-group .form-control, .input-group .form-select {
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
  border-right: none;
}

.input-group .btn {
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  font-weight: 500;
  transition: var(--transition);
}

.input-group .btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: none;
}

/* 复选框美化 */
.form-check {
  padding-left: 2.5rem;
  margin-bottom: 1rem;
}

.form-check-input {
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid #cbd5e0;
  border-radius: 6px;
  margin-left: -2.5rem;
  margin-top: 0.2rem;
  transition: var(--transition);
}

.form-check-input:checked {
  background-color: var(--success-color);
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.form-check-input:focus {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

/* 按钮样式 */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
}

.btn {
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-outline-secondary {
  background: transparent;
  border-color: #cbd5e0;
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: #f7fafc;
  border-color: var(--text-secondary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* 表单文本提示 */
.form-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-light);
  border-radius: 8px;
  border-left: 3px solid var(--primary-light);
}

/* 错误提示样式 */
.invalid-feedback {
  color: var(--danger-color);
  font-weight: 500;
  background: rgba(245, 101, 101, 0.1);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  border-left: 3px solid var(--danger-color);
}

.alert {
  border-radius: var(--border-radius-sm);
  border: none;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.alert-danger {
  background: linear-gradient(135deg, #fed7d7, #feb2b2);
  color: #742a2a;
}

.alert-warning {
  background: linear-gradient(135deg, #feebc8, #fed7a8);
  color: #744210;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loss-detail-card {
  animation: fadeInUp 0.6s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .loss-detail-card-body {
    padding: 1.5rem;
  }

  .exam-info-section .info-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .loss-detail-card-header {
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .loss-detail-card-header .back-link {
    align-self: center;
  }
}

/* 加载状态 */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* 成功状态指示 */
.success-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success-color);
  font-weight: 500;
}

.success-indicator::before {
  content: '✓';
  background: var(--success-color);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}